package edu.unindra.elearning;

import java.awt.Font;

import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import edu.unindra.elearning.form.addin.ELearningFormMain;
import edu.unindra.elearning.util.ButtonImageReflection;

public class ELearningGroupLayout {
	private static ButtonImageReflection btnPlay;

	private static JButton btnExit;
	private static JButton btnHelp;
	private static JButton btnAbout;

	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);

		btnPlay = new ButtonImageReflection();
		btnPlay.setFont(new Font("Tahoma", Font.BOLD, 18));
		btnPlay.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		btnPlay.setIcon(new ImageIcon(ELearningFormMain.class
				.getResource("/edu/unindra/elearning/image/myofficelogo.png")));
		btnPlay.setText("Play");

		btnExit = new JButton();
		btnExit.setVerticalAlignment(SwingConstants.BOTTOM);
		btnExit.setSelectedIcon(null);
		btnExit.setFont(new Font("Tahoma", Font.BOLD, 14));
	//	btnExit.setHorizontalAlignment(SwingConstants.TRAILING);
		btnExit.setIcon(new ImageIcon(ELearningFormMain.class
				.getResource("/edu/unindra/elearning/image/Exit.png")));
		btnExit.setText("Exit         ");

		btnHelp = new JButton();
		btnHelp.setVerticalAlignment(SwingConstants.BOTTOM);
		btnHelp.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 13));
		btnHelp.setSelectedIcon(new ImageIcon(
				"D:\\Private\\Campus\\Skripsi\\Iir\\image\\Exit.png"));
		btnHelp.setIcon(new ImageIcon(ELearningFormMain.class
				.getResource("/edu/unindra/elearning/image/Info.png")));
		btnHelp.setText("Help");

		btnAbout = new JButton();
		btnAbout.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 13));
		btnAbout.setIcon(new ImageIcon(ELearningFormMain.class
				.getResource("/edu/unindra/elearning/image/Profile.png")));
		btnAbout.setVerticalAlignment(SwingConstants.BOTTOM);
		btnAbout.setText("About");

		GroupLayout.SequentialGroup leftToRight = layout
				.createSequentialGroup();
		leftToRight.addComponent(btnHelp);

		GroupLayout.ParallelGroup columnMiddle = layout.createParallelGroup();
		columnMiddle.addComponent(btnPlay);
		columnMiddle.addComponent(btnExit);
		leftToRight.addGroup(columnMiddle);
		leftToRight.addComponent(btnAbout);

		GroupLayout.SequentialGroup topToBottom = layout
				.createSequentialGroup();
		GroupLayout.ParallelGroup rowTop = layout.createParallelGroup();
		topToBottom.addComponent(btnPlay);
		topToBottom.addComponent(btnExit);

		rowTop.addComponent(btnHelp);
		rowTop.addComponent(btnAbout);
		topToBottom.addGroup(rowTop);

		layout.setHorizontalGroup(leftToRight);
		layout.setVerticalGroup(topToBottom);

		frame.add(panel);
		frame.pack();
		frame.setVisible(true);
	}
}
